package obj.day1.exam;

/**
 * @author げっしょく
 * @date 2021/7/15
 */
public class Test02 {
    /**
     * 我们计划为一所体育学校设计一套系统，需要记录以下人员的信息：
     * 	教练员Teach：
     * 		属性：员工编号、姓名、性别、年龄
     * 		行为：吃饭(吃工作餐)
     * 	运动员Player：
     * 		属性：学员编号、姓名、性别、年龄、所在班级
     * 		行为：吃饭(吃营养餐)
     * @param args
     */
    public static void main(String[] args) {
        Teach t = new Teach("1542477","张三","男",35);
        t.eat();
        Player p = new Player("15487522","李玲","女",19,"跑步c255班");
        p.eat();
    }
}
class Player extends PeoPle{
    private String Banji;
    public String toString(){
        return "学员编码："+this.getId()+", 姓名："+this.getName()+", 性别："+this.getSex()+", 年龄："+this.getAge()+", 所在班级："+this.getBanji();
    }

    @Override
    public void eat() {
        System.out.println(toString());
        System.out.println("吃营养餐！！");
    }

    public Player() {

    }

    public Player(String id, String name, String sex, int age, String banji) {
        super(id, name, sex, age);
        Banji = banji;
    }

    public String getBanji() {
        return Banji;
    }

    public void setBanji(String banji) {
        Banji = banji;
    }
}
class Teach extends PeoPle{
    public String toString(){
        return "教练编码："+this.getId()+", 姓名："+this.getName()+", 性别："+this.getSex()+", 年龄："+this.getAge();
    }
    public void eat(){
        System.out.println(toString());
        System.out.println("吃工作餐！！");
    }

    public Teach() {
    }

    public Teach(String id, String name, String sex, int age) {
        super(id, name, sex, age);
    }
}
abstract class PeoPle{
    private String id;
    private String name;
    private String sex;
    private int age;

    public PeoPle() {
    }

    public PeoPle(String id, String name, String sex, int age) {
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.age = age;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
    public abstract void eat();
}
